home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 October / EnigmA AMIGA RUN 31 (1998)(G.R. Edizioni)(IT)[!][issue 1998-10].iso / earkit / browser / awebdecoders / awebgif / awebgif.awebrx < prev    next >
Text File  |  1998-09-22  |  6KB  |  156 lines

  1. /* awebgif.awebrx - Install or uninstall the AWeb GIF plugin */
  2.  
  3. options results
  4.  
  5. if left(address(),5)~="AWEB." then do
  6.    ports=show("P")
  7.    parse var ports dummy "AWEB." portnr .
  8.    if portnr="" then do
  9.       address command "run AWeb3:AWeb-II"
  10.       address command "WaitForPort AWEB.1"
  11.       portnr=1
  12.    end
  13.    address value "AWEB."portnr
  14.    'get activeport'
  15.    address value result
  16. end
  17.  
  18. parse arg args
  19. parse source dummy1 dummy2 called .
  20. i=lastpos(called,'/')
  21. if i==0 then i=lastpos(called,':')
  22. if i>0 then path=left(called,i)
  23. else path=''
  24.  
  25. if args='' then do
  26.    if ~open(tf,"T:awebgifsetup.html","W") then exit
  27.  
  28.    call writeln tf,"<html><head><title>AWeb GIF Setup</title></head>"
  29.    call writeln tf,"<body><h1>AWeb GIF Setup</h1>"
  30.    
  31.    if exists("AWebPath:awebplugin/awebgif.awebplugin") then do
  32.       installed=0
  33.       progress=4
  34.       animate=1
  35.       lowpri=0
  36.       'getcfg MIME stem m'
  37.       do i=1 to m.0
  38.          if upper(left(m.i.value,10))="IMAGE/GIF;" then do
  39.             parse var m.i.value type ";" ext ";" action ";" file ";" args
  40.             if action='A' & upper(right(file,18))="AWEBGIF.AWEBPLUGIN" then do
  41.                installed=1
  42.                j=index(upper(args),"PROGRESS=")
  43.                if j>0 then do
  44.                   progress=substr(args,j+9)
  45.                   j=verify(progress,"0123456789")
  46.                   if j>0 then progress=left(progress,j-1)
  47.                end
  48.                j=index(upper(args),"ANIMATE=")
  49.                if j>0 then animate=substr(args,j+8,1)
  50.                lowpri=(index(upper(args),"LOWPRI")>0)
  51.             end
  52.             leave
  53.          end
  54.       end
  55.       
  56.       call writeln tf,"<table border width=100% bgcolor=#aaccaa><tr><td>"
  57.       call writeln tf,"<form action='x-aweb:rexx/"called"'>"
  58.       call writeln tf,"This form configures AWeb-II to use the <strong> AWeb GIF plugin</strong>."
  59.       call writeln tf,"<input type=hidden name=defprogress value="progress">"
  60.       call writeln tf,"<ol><li>Select the required modes of operation "
  61.       call writeln tf,"(see <a href='file:///AWebPath:awebplugin/docs/awebgif.html#parameters'>documentation</a> for details)"
  62.       call writeln tf,"<p><ul><li>Progressive display:<br>"
  63.       call writeln tf,"<input type=radio name=progress value=0"
  64.       if progress=0 then call writeln tf," checked"
  65.       call writeln tf,"> No progressive display (fastest)<br>"
  66.       call writeln tf,"<input type=radio name=progress value=4"
  67.       if progress=4 then call writeln tf," checked"
  68.       call writeln tf,"> Standard progressive display<br>"
  69.       call writeln tf,"<input type=radio name=progress value=1"
  70.       if progress=1 then call writeln tf," checked"
  71.       call writeln tf,"> Smooth progressive display (slowest)<br>"
  72.       call writeln tf,"<p><li>Animation playback:<br>"
  73.       call writeln tf,"<input type=radio name=animate value=1"
  74.       if animate=1 then call writeln tf," checked"
  75.       call writeln tf,"> Play back animations<br>"
  76.       call writeln tf,"<input type=radio name=animate value=0"
  77.       if animate=0 then call writeln tf," checked"
  78.       call writeln tf,"> No animations (faster and needs less memory)<br>"
  79.       call writeln tf,"<p><li>Multitasking:<br>"
  80.       call writeln tf,"<input type=checkbox name=lowpri value='LOWPRI'"
  81.       if lowpri then call writeln tf," checked"
  82.       call writeln tf,"> Run decoder at low priority<br>"
  83.       call writeln tf,"</ul>"
  84.       call writeln tf,"<p><li><input type=checkbox name=save value=yes checked> Save the new settings"
  85.       call writeln tf,"<p><li><input type=submit value='Install AWeb GIF plugin'>"
  86.       call writeln tf,"</ol></form></table>"
  87.  
  88.       if installed>0 then do
  89.          call writeln tf,"<p><table border width=100% bgcolor=#ccaaaa><tr><td>"
  90.          call writeln tf,"<form action='x-aweb:rexx/"called"'>"
  91.          call writeln tf,"<input type=hidden name=deinstall value=''>"
  92.          call writeln tf,"This form will deinstall the AWeb GIF plugin and reset the default (datatypes) decoder for GIF images."
  93.          call writeln tf,"<ol><li><input type=checkbox name=save value=yes checked> Save the new settings"
  94.          call writeln tf,"<p><li><input type=submit value='De-install AWeb GIF plugin'>"
  95.          call writeln tf,"</ol></form></table>"
  96.       end
  97.  
  98.    end
  99.    else do
  100.       call writeln tf,"Plugin file not found. You have to run the install script first."
  101.    end
  102.    
  103.    call writeln tf,"<p><hr><p><a href='file:///AWebPath:awebplugin/docs/awebgif.html'>Back to documentation</a>"
  104.    
  105.    call close tf
  106.    'open "file:///T:awebgifsetup.html" reload'
  107.    'wait "file:///T:awebgifsetup.html"'
  108.    'allowcmd'
  109.    address command 'delete T:awebgifsetup.html quiet'
  110.  
  111. end
  112. else do
  113.    
  114.    ext="gif"
  115.    rest=";"
  116.    
  117.    'getcfg MIME stem m'
  118.    do i=1 to m.0
  119.       if upper(left(m.i.value,10))="IMAGE/GIF;" then do
  120.          parse var m.i.value type ";" ext ";" action ";" rest
  121.          leave
  122.       end
  123.    end
  124.  
  125.    if upper(left(args,9))="DEINSTALL" then do
  126.       mime="IMAGE/GIF;"ext";;"rest
  127.    end
  128.    else do
  129.       progress=""
  130.       defprogress="4"
  131.       animate="1"
  132.       lowpri=""
  133.       save=""
  134.       
  135.       do while args~=""
  136.          parse var args nextarg args
  137.          interpret nextarg
  138.       end
  139.       
  140.       if progress="" then progress=defprogress
  141.       mime="IMAGE/GIF;"ext";A;AWebPath:awebplugin/awebgif.awebplugin;PROGRESS="progress" ANIMATE="animate lowpri
  142.    end
  143.    
  144.    'setcfg MIME "'mime'" ADD'
  145.  
  146.    if upper(save)="YES" then do
  147.       'savesettings'
  148.    end
  149.  
  150.    'open "file:///AWebPath:awebplugin/docs/awebgif.html"'
  151.  
  152. end
  153.  
  154. exit
  155.  
  156.